﻿// 开发者:micropu
// 公司:佛山远钧智慧科技有限公司

using Admin.NET.Core;
using Elastic.Clients.Elasticsearch.Xpack;
using Newtonsoft.Json;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Application;

/// <summary>
/// 旧数据同步
/// </summary>
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 1000)]
public class OldDataSync : IDynamicApiController, ITransient
{
    private readonly SqlSugarRepository<Project> _projectRep;
    private readonly SqlSugarRepository<Device> _deviceRep;
    private readonly SqlSugarRepository<Employee> _employeeRep;
    private readonly SqlSugarRepository<CaiJiPhotos> _caiJiPhotosRep;
    public OldDataSync(SqlSugarRepository<Project> projectRep, SqlSugarRepository<Device> deviceRep, SqlSugarRepository<Employee> employeeRep, SqlSugarRepository<CaiJiPhotos> caiJiPhotosRep)
    {
        _projectRep = projectRep;
        _deviceRep = deviceRep;
        _employeeRep = employeeRep;
        _caiJiPhotosRep = caiJiPhotosRep;
    }

    /// <summary>
    /// 项目数据迁移
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    [ApiDescriptionSettings(Name = "oldproject")]
    [DisplayName("项目数据迁移")]
    public async void oldproject()
    {
        SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
        {
                    ConnectionString = "Server=121.9.243.235,1420;Database=ZhuJian;User=sa;Password=@Zhipu314115;MultipleActiveResultSets=True;Connection Timeout=30;",
                    DbType = DbType.SqlServer,
                    IsAutoCloseConnection = true
                },
        db => {});


        string sql = "select * from  App_Project where TenantId=228715131400261 and OrgId<>0";
        List<OldProject> t = Db.Ado.SqlQuery<OldProject>(sql);
        //Console.WriteLine(JsonConvert.SerializeObject(t));
        foreach (OldProject p in t) {
            Console.WriteLine(p.Name);
            var et = new Project();
            et.Name = p.Name;
            et.Id = p.Id;
            et.TenantId = 564931111632965;
            et.CreateOrgId = 564931111686213;
            et.CreateOrgName = "远钧科技";
            et.CreateTime = DateTime.Now;
            et.CreateUserId = 564931112083525;
            et.CreateUserName = "租管";
            et.ServerIP = "121.9.243.235";
            et.ServerPort = "22001";
            et.ManufacturerId = "fc7f8278faf44b03aaea69b8a9f54e43";
            et.IsDelete = false;
            await _projectRep.InsertAsync(et);
        }
        Console.WriteLine(t.Count);
    }

    /// <summary>
    /// 设备数据迁移
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    [ApiDescriptionSettings(Name = "olddevice")]
    [DisplayName("设备数据迁移")]
    public async void olddevice()
    {
        SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
        {
            ConnectionString = "Server=121.9.243.235,1420;Database=ZhuJian;User=sa;Password=@Zhipu314115;MultipleActiveResultSets=True;Connection Timeout=30;",
            DbType = DbType.SqlServer,
            IsAutoCloseConnection = true
        },
        db => { });

        string sql = "select * from  App_Device where TenantId=228715131400261 and OrgId<>0 and IsDeleted=0";
        List<OldDevice> t = Db.Ado.SqlQuery<OldDevice>(sql);
        //Console.WriteLine(JsonConvert.SerializeObject(t));
        foreach (OldDevice p in t)
        {
            Console.WriteLine(p.Name);
            var et = new Device();
            et.ProjectId = p.ProjectId;
            et.TenantId = 564931111632965;
            et.CreateOrgId = 564931111686213;
            et.CreateOrgName = "远钧科技";
            et.CreateTime = DateTime.Now;
            et.CreateUserId = 564931112083525;
            et.CreateUserName = "租管";
            et.IsDelete = false;
            et.Name = p.Name;
            et.ClientSn = p.ClientSn;
            et.Direction = p.Direction == 0? DirectionType.@in :DirectionType.@out;


            et.DeviceConnect = ConnectType.TCP_SOCKET;
            et.DeviceModel = ModelType.CV_EV_DV;
            et.EnableEmpSend = true;
            et.EnableRecLog = true;
            et.EnableRecNotMatchUploadLog = false;
            et.EnableGetEmpInfo = false;
            await _deviceRep.InsertAsync(et);
        }
        Console.WriteLine(t.Count);
    }

    /// <summary>
    /// 人员数据迁移
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    [ApiDescriptionSettings(Name = "oldEmp")]
    [DisplayName("人员数据迁移")]
    public async void oldEmp()
    {
        SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
        {
            ConnectionString = "Server=121.9.243.235,1420;Database=ZhuJian;User=sa;Password=@Zhipu314115;MultipleActiveResultSets=True;Connection Timeout=30;",
            DbType = DbType.SqlServer,
            IsAutoCloseConnection = true
        },
        db => { });

        string sql = "select * from  App_Employee where TenantId=228715131400261 and OrgId<>0 and IsDeleted=0";
        List<OldEmployee> t = Db.Ado.SqlQuery<OldEmployee>(sql);
        //Console.WriteLine(JsonConvert.SerializeObject(t));
        foreach (OldEmployee p in t)
        {
            var project = await _projectRep.GetFirstAsync(u => u.Id == p.ProjectId);
            if (project!=null)
            {
                //承安集团
                if (project.Id == 526612085555269)
                {
                    var et = new Employee();
                    et.Id = p.Id;
                    et.ProjectId = p.ProjectId;
                    et.TenantId = 564931111632965;
                    et.CreateOrgId = 587043604750405;
                    et.CreateOrgName = "承安集团智能工厂";
                    et.CreateTime = DateTime.Now;
                    et.CreateUserId = 587044453773381;
                    et.CreateUserName = "承安集团";
                    et.IsDelete = false;
                    et.Name = p.Name;
                    et.ZjEmpID = p.EmpGuid;
                    et.IdNum = p.IdNum;
                    et.Age = p.Age;
                    et.Facephoto = p.ImageBase64;
                    et.IsAutoAudit = p.IsAutoAudit;
                    et.IsMobile = p.IsMobileDk;
                    et.MobileAccount = p.IdNum;
                    await _employeeRep.InsertAsync(et);
                }
                else if (project.Id == 524557599584325)    //广宇
                {
                    var et = new Employee();
                    et.Id = p.Id;
                    et.ProjectId = p.ProjectId;
                    et.TenantId = 564931111632965;
                    et.CreateOrgId = 587043480744005;
                    et.CreateOrgName = "广宇科技大厦";
                    et.CreateTime = DateTime.Now;
                    et.CreateUserId = 587044239122501;
                    et.CreateUserName = "广宇科技大厦";
                    et.IsDelete = false;
                    et.Name = p.Name;
                    et.ZjEmpID = p.EmpGuid;
                    et.IdNum = p.IdNum;
                    et.Age = p.Age;
                    et.Facephoto = p.ImageBase64;
                    et.IsAutoAudit = p.IsAutoAudit;
                    et.IsMobile = p.IsMobileDk;
                    et.MobileAccount = p.IdNum;
                    await _employeeRep.InsertAsync(et);
                }
                else {
                    var et = new Employee();
                    et.Id = p.Id;
                    et.ProjectId = p.ProjectId;
                    et.TenantId = 564931111632965;
                    et.CreateOrgId = 564931111686213;
                    et.CreateOrgName = "远钧科技";
                    et.CreateTime = DateTime.Now;
                    et.CreateUserId = 564931112083525;
                    et.CreateUserName = "租管";
                    et.IsDelete = false;
                    et.Name = p.Name;
                    et.ZjEmpID = p.EmpGuid;
                    et.IdNum = p.IdNum;
                    et.Age = p.Age;
                    et.Facephoto = p.ImageBase64;
                    et.IsAutoAudit = p.IsAutoAudit;
                    et.IsMobile = p.IsMobileDk;
                    et.MobileAccount = p.IdNum;
                    await _employeeRep.InsertAsync(et);
                }
            }

            
        }
        Console.WriteLine(t.Count);
    }

    [HttpPost]
    [ApiDescriptionSettings(Name = "oldclose")]
    [DisplayName("分组衣服")]
    public async void oldclose()
    {
        //SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
        //{
        //    ConnectionString = "Server=121.9.243.235,1420;Database=ZhuJian;User=sa;Password=@Zhipu314115;MultipleActiveResultSets=True;Connection Timeout=30;",
        //    DbType = DbType.SqlServer,
        //    IsAutoCloseConnection = true
        //},
        //db => { });

        //string sql = "select * from  App_EmployeeDK";
        //List<EmployeeDK> t = Db.Ado.SqlQuery<EmployeeDK>(sql);
        //foreach (EmployeeDK p in t)
        //{
        //    var et = new CaiJiPhotos();
        //    et.EmployeeId = p.EmployeeId;
        //    et.TenantId = 564931111632965;
        //    et.CreateOrgId = 564931111686213;
        //    et.CreateOrgName = "远钧科技";
        //    et.CreateTime = DateTime.Now;
        //    et.CreateUserId = 564931112083525;
        //    et.CreateUserName = "租管";
        //    et.IsDelete = false;
        //    et.ClothesGroup = p.ClothesGroup;
        //    et.Direction = (DirectionType)p.Direction;

        //    // 将字符串以逗号分割，并去掉扩展名
        //    List<string> result = p.Photos
        //        .Split(',')
        //        .Select(file => System.IO.Path.GetFileNameWithoutExtension(file))
        //        .ToList();
        //    et.Photos = result;
        //    await _caiJiPhotosRep.InsertAsync(et);

        //单衣服数据

        SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
        {
            ConnectionString = "Server=121.9.243.235,1420;Database=ZhuJian;User=sa;Password=@Zhipu314115;MultipleActiveResultSets=True;Connection Timeout=30;",
            DbType = DbType.SqlServer,
            IsAutoCloseConnection = true
        },
        db => { });

        string sql = "select * from  App_Employee where ismobiledk=1 and IsDeleted=0 and inphotos <>'' and inphotos IS NOT NULL";
        List<OldEmployee> t = Db.Ado.SqlQuery<OldEmployee>(sql);
        foreach (OldEmployee p in t)
        {
            var et = new CaiJiPhotos();
            et.EmployeeId = p.Id;
            et.TenantId = 564931111632965;
            et.CreateOrgId = 564931111686213;
            et.CreateOrgName = "远钧科技";
            et.CreateTime = DateTime.Now;
            et.CreateUserId = 564931112083525;
            et.CreateUserName = "租管";
            et.IsDelete = false;
            et.ClothesGroup = 1;
            et.Direction = DirectionType.@in;

            // 将字符串以逗号分割，并去掉扩展名
            List<string> result = p.InPhotos
                .Split(',')
                .Select(file => System.IO.Path.GetFileNameWithoutExtension(file))
                .ToList();
            et.Photos = result;
            await _caiJiPhotosRep.InsertAsync(et);

            var et1 = new CaiJiPhotos();
            et1.EmployeeId = p.Id;
            et1.TenantId = 564931111632965;
            et1.CreateOrgId = 564931111686213;
            et1.CreateOrgName = "远钧科技";
            et1.CreateTime = DateTime.Now;
            et1.CreateUserId = 564931112083525;
            et1.CreateUserName = "租管";
            et1.IsDelete = false;
            et1.ClothesGroup = 1;
            et1.Direction = DirectionType.@out;

            // 将字符串以逗号分割，并去掉扩展名
            List<string> result1 = p.OutPhotos
                .Split(',')
                .Select(file => System.IO.Path.GetFileNameWithoutExtension(file))
                .ToList();
            et1.Photos = result1;
            await _caiJiPhotosRep.InsertAsync(et1);
        }
    }
}


/// <summary>
/// 人员手机卡打表
/// </summary>
public class EmployeeDK : AppDEntityTenant
{
    /// <summary>
    /// 人员ID
    /// </summary>
    public long EmployeeId { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 衣服组
    /// </summary>
    public int ClothesGroup { get; set; }

    /// <summary>
    /// 进出方向，1进，2出
    /// </summary>
    public int Direction { get; set; }

    /// <summary>
    /// 图片数组
    /// </summary>
    public string Photos { get; set; }
}


/// <summary>
/// 业务OrgID和自定义租户基类实体
/// </summary>
public abstract class AppDEntityTenant 
{
    public long Id { get; set; }
    public virtual long? TenantId { get; set; }

    public virtual long? OrgId { get; set; }
}

/// <summary>
/// 公共状态
/// </summary>
public enum CommonStatus
{
    /// <summary>
    /// 正常
    /// </summary>
    [Description("正常")]
    ENABLE = 0,

    /// <summary>
    /// 停用
    /// </summary>
    [Description("停用")]
    DISABLE = 1,

    /// <summary>
    /// 删除
    /// </summary>
    [Description("删除")]
    DELETED = 2
}

/// <summary>
/// 项目列表
/// </summary>
public class OldProject : AppDEntityTenant
{
    /// <summary>
    /// 名称
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 存放旧项目的ID
    /// </summary>
    public string OldProjectID { get; set; }

    /// <summary>
    /// 对接平台
    /// </summary>
    public PlatformType Platform { get; set; }

    /// <summary>
    /// 人员散列
    /// </summary>
    public string EmpHash { get; set; }

    /// <summary>
    /// 状态（字典 0正常 1停用 2删除）
    /// </summary>
    public CommonStatus Status { get; set; } = CommonStatus.ENABLE;


    /// <summary>
    /// 人员拉取开关
    /// </summary>
    public bool EnablePull { get; set; } = false;

    /// <summary>
    /// 人员下发开关
    /// </summary>
    public bool EnableSend { get; set; } = false;

    /// <summary>
    /// 项目唯一标识码
    /// </summary>
    public string ProjectOnlyID { get; set; }


    /// <summary>
    /// 公司名称
    /// </summary>
    public string CompanyName { get; set; }

    /// <summary>
    /// 公司营业执照编号
    /// </summary>

    public string CompanyNumber { get; set; }

    /// <summary>
    /// 通行记录开关
    /// </summary>
    public bool EnableLog { get; set; } = false;


}


/// <summary>
/// 设备型号
/// </summary>
public enum DeviceModelType
{
    /// <summary>
    /// CV500
    /// </summary>
    [Description("CV500")]
    CV500 = 0,

    /// <summary>
    /// 宇视UNV
    /// </summary>
    [Description("宇视UNV")]
    UNV = 1,

    /// <summary>
    /// 其它
    /// </summary>
    [Description("其它")]
    OTHER = 2
}

/// <summary>
/// 设备连接类型
/// </summary>
public enum DeviceConnectType
{
    /// <summary>
    /// SOCKET
    /// </summary>
    [Description("SOCKET")]
    SOCKET = 0,

    /// <summary>
    /// HTTP轮询
    /// </summary>
    [Description("HTTP轮询")]
    Polling = 1,

    /// <summary>
    /// 接口中转
    /// </summary>
    [Description("接口中转")]
    Transit = 2
}

/// <summary>
/// 设备列表
/// </summary>
public class OldDevice : AppDEntityTenant
{
    /// <summary>
    /// 名称
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 通信方式
    /// </summary>
    public DeviceConnectType DeviceConnect { get; set; }

    /// <summary>
    /// 设备型号
    /// </summary>
    public DeviceModelType DeviceModel { get; set; }

    /// <summary>
    /// 项目Id
    /// </summary>
    public long ProjectId { get; set; }

    /// <summary>
    /// 所属项目
    /// </summary>
    public Project Project { get; set; }

    /// <summary>
    /// 服务端设备号
    /// </summary>
    public string ServerSn { get; set; }

    /// <summary>
    /// 客户端设备号
    /// </summary>
    public string ClientSn { get; set; }

    /// <summary>
    /// 通行方向
    /// </summary>
    public int Direction { get; set; } 

    /// <summary>
    /// 人员散列
    /// </summary>
    public string EmpHash { get; set; }

    /// <summary>
    /// gx_api_secret广西南海通用
    /// </summary>
    public string gx_api_secret { get; set; }

    /// <summary>
    /// gx_api_key广西南海通用
    /// </summary>
    public string gx_api_key { get; set; }

    /// <summary>
    /// 项目唯一ID-南海
    /// </summary>
    public string ProjectOnlyID { get; set; }

    /// <summary>
    /// 公司ID-南海
    /// </summary>
    public string CompanyID { get; set; }

    /// <summary>
    /// 施工单位唯一码-南海
    /// </summary>
    public string CompanyOnlyCode { get; set; }

    /// <summary>
    /// 是否在线
    /// </summary>
    public bool IsOnline { get; set; }

    /// <summary>
    /// 状态（字典 0正常 1停用 2删除）
    /// </summary>
    public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
}


/// <summary>
/// 人员手机卡打表
/// </summary>
public class OldEmployeeDK : AppDEntityTenant
{
    /// <summary>
    /// 人员ID
    /// </summary>
    public long EmployeeId { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 衣服组
    /// </summary>
    public int ClothesGroup { get; set; }

    /// <summary>
    /// 进出方向，1进，2出
    /// </summary>
    public int Direction { get; set; }

    /// <summary>
    /// 图片数组
    /// </summary>
    public string Photos { get; set; }
}

/// <summary>
/// 移动打卡类型
/// </summary>
public enum MobileDkType
{
    /// <summary>
    /// 手机打卡
    /// </summary>
    [Description("手机打卡")]
    ByPhoto = 1,

    /// <summary>
    /// 自动分配
    /// </summary>
    [Description("自动分配")]
    ByAuto = 2,
}

/// <summary>
/// 人员表
/// </summary>
public class OldEmployee : AppDEntityTenant
{
    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 年龄
    /// </summary>
    public int Age { get; set; }

    /// <summary>
    /// 工种
    /// </summary>
    public string Category { get; set; }

    /// <summary>
    /// 项目Id
    /// </summary>
    public long ProjectId { get; set; }

    /// <summary>
    /// 所属项目
    /// </summary>
    public Project Project { get; set; }

    /// <summary>
    /// 人员UID
    /// </summary>
    public string EmpGuid { get; set; }

    /// <summary>
    /// 人脸图片Url
    /// </summary>
    public string Facephoto_Url { get; set; }

    /// <summary>
    /// Base64
    /// </summary>
    public string ImageBase64 { get; set; }


    /// <summary>
    /// 工作组
    /// </summary>
    public string Work_TypeName { get; set; }

    /// <summary>
    /// 身份证号
    /// </summary>
    public string IdNum { get; set; }

    /// <summary>
    /// 民族
    /// </summary>

    public string Nation { get; set; }

    /// <summary>
    /// 生日
    /// </summary>
    public string Birthday { get; set; }

    /// <summary>
    /// 住址
    /// </summary>
    public string Address { get; set; }

    /// <summary>
    /// 户籍
    /// </summary>
    public string Native { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    public string Phone { get; set; }

    /// <summary>
    /// 紧急联系人
    /// </summary>

    public string EmerPeople { get; set; }

    /// <summary>
    /// 紧急联系人电话
    /// </summary>
    public string EmerPhone { get; set; }

    /// <summary>
    /// 文化程度
    /// </summary>
    public int Culture { get; set; }

    /// <summary>
    /// 健康状况
    /// </summary>
    public int Health { get; set; }

    /// <summary>
    /// 签发机关（长度20个字符）
    /// </summary>
    public string QianFaJiGuan { get; set; }

    /// <summary>
    /// 工种顺德专用
    /// </summary>
    public int WorkerType { get; set; }

    /// <summary>
    /// 公司名称-顺德专用
    /// </summary>
    public string CompanyName { get; set; }

    /// <summary>
    /// 社会统一信用代码
    /// </summary>
    public string CompanyNumber { get; set; }

    /// <summary>
    /// 身份证正面照（文件ID）
    /// </summary>
    public string Photo { get; set; }

    /// <summary>
    /// 身份证反面照 （文件Id）
    /// </summary>
    public string IDcardNumPicFanMian { get; set; }

    /// <summary>
    /// 身份证起始日期（格式：2000-01-01）
    /// </summary>
    public string QiXianQiShi { get; set; }

    /// <summary>
    /// 身份证失效日期（无失效日期传”长期”）
    /// </summary>
    public string QiXianShiXiao { get; set; }

    /// <summary>
    /// 人脸照片（文件ID）
    /// </summary>
    public string DocumentID { get; set; }

    /// <summary>
    /// 是否顺德住建人员
    /// </summary>
    public bool IsSdEmp { get; set; } = false;

    /// <summary>
    /// 是否已上传）
    /// </summary>
    public bool Sd_isUpload { get; set; } = false;

    /// <summary>
    /// 是否已进场
    /// </summary>
    public bool Sd_IsIn { get; set; } = false;

    /// <summary>
    /// 是否施工单位人员
    /// </summary>
    public bool SgDwEmp { get; set; } = true;

    /// <summary>
    /// 是否自建人员，否为住建下发
    /// </summary>
    public bool CreateByOwn { get; set; } = false;

    /// <summary>
    /// 银行名称
    /// </summary>
    public string BankName { get; set; }

    /// <summary>
    /// 银行账号
    /// </summary>
    public string BankAccount { get; set; }

    /// <summary>
    /// 劳务合同
    /// </summary>
    public string ContractID { get; set; }

    /// <summary>
    /// 服务器人员修改时间
    /// </summary>
    public string ServiceModifyTime { get; set; }

    /// <summary>
    /// 移动端留言
    /// </summary>
    public string MobileMsg { get; set; }

    /// <summary>
    /// 移动打卡类型
    /// </summary>
    public MobileDkType MobileDkType { get; set; }

    /// <summary>
    /// 是否自动审核
    /// </summary>
    public bool IsAutoAudit { get; set; } = false;

    /// <summary>
    /// 是否允许移动打卡
    /// </summary>
    public bool IsMobileDk { get; set; } = false;

    /// <summary>
    /// 是否分衣组
    /// </summary>
    public bool IsClothesGroup { get; set; } = false;

    /// <summary>
    /// 自动打卡图片数组
    /// </summary>
    public string IsAutoAuditPhoto { get; set; }

    /// <summary>
    /// 进门图片数组
    /// </summary>
    public string InPhotos { get; set; }

    /// <summary>
    /// 出门图片数组
    /// </summary>
    public string OutPhotos { get; set; }

    /// <summary>
    /// 进门最后使用图片
    /// </summary>
    public string LatestInPhoto { get; set; }

    /// <summary>
    /// 出门最后使用图片
    /// </summary>
    public string LatestOutPhoto { get; set; }

    /// <summary>
    /// 最近一次打卡图片
    /// </summary>
    public string IsAutoAuditPhotoLatest { get; set; }

    /// <summary>
    /// 采集照片长度,市局专用
    /// </summary>
    public int PicLen { get; set; }

    /// <summary>
    /// 是否同步到设备
    /// </summary>
    public bool IsSendClient { get; set; } = false;

    /// <summary>
    /// 同步人员到设备错误信息
    /// </summary>
    public string SendClientErr { get; set; } = "";
}

/// <summary>
/// 排班表
/// </summary>
public class PaiBan : AppDEntityTenant
{
    /// <summary>
    /// 人员ID
    /// </summary>
    public long EmployeeId { get; set; }

    //开始时间
    public DateTime StartTime { get; set; }

    //结束时间
    public DateTime? EndTime { get; set; }

    //工作组 workgroup
    public string WorkGroup { get; set; }

}

/// <summary>
/// 设备列表
/// </summary>
public class SdProjectTeam : AppDEntityTenant
{
    /// <summary>
    /// 公司营业执照编号
    /// </summary>
    public string CompanyNumber { get; set; }
    /// <summary>
    /// 项目唯一标识码，可在实名制平台项目详细信息处获取
    /// </summary>
    public string ProjectNumber { get; set; }

    /// <summary>
    /// 项目Id
    /// </summary>

    public long ProjectId { get; set; }

    /// <summary>
    /// Token
    /// </summary>
    public string Token { get; set; }

    /// <summary>
    /// 班组名称
    /// </summary>

    public string TeamName { get; set; }
    /// <summary>
    /// 工程承包内容
    /// </summary>
    public string ProjectPart { get; set; }
    /// <summary>
    /// 承包合同金额
    /// </summary>
    public int ContractSum { get; set; }
    /// <summary>
    /// 班组长姓名
    /// </summary>
    public string Name { get; set; }
    /// <summary>
    /// 班组长联系方式
    /// </summary>
    public string Tel { get; set; }
    /// <summary>
    /// 班组长身份证号
    /// </summary>
    public string IDNum { get; set; }
    /// <summary>
    /// 紧急联系人
    /// </summary>
    public string EmerPeople { get; set; }
    /// <summary>
    /// 紧急联系人电话
    /// </summary>
    public string EmerTel { get; set; }
    /// <summary>
    /// 合同文件在文件系统上的ID（调用接口3.10的返回结果），必须上传合同
    /// </summary>
    public string ContractID { get; set; }
}